<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\IssueController;
use App\Http\Controllers\CommentController;


Route::get('/hello', function () {
    printf("Hello, %s\n", "World");

    return response()->json(['message' => 'Hello, World!']);
});

Route::post('/register', [AuthController::class, 'register']);
Route::post('/login', [AuthController::class, 'login']);

Route::middleware('auth:api')->group(function () {
    Route::get('/user', [AuthController::class, 'getUser']);
    Route::post('/user', [AuthController::class, 'updateProfile']);
    Route::post('/issues', [IssueController::class, 'createIssue']);
    Route::get('/issues', [IssueController::class, 'listIssues']);
    Route::post('/issues/{issueId}/comments', [CommentController::class, 'addComment']);
    Route::post('/issues/{issueId}/transfer', [CommentController::class, 'transferComment']);

});




